package com.ocm.core.mapping;

import org.springframework.stereotype.Component;

import com.ocm.core.domain.PropertyType;
import com.googlecode.simpleobjectassembler.converter.AbstractObjectConverter;


@Component
public class PropertyTypeToIntegerConvert extends AbstractObjectConverter<PropertyType, Integer> {

   @Override
   public void convert(PropertyType sourceObject, Integer destinationObject) {
      destinationObject = Integer.valueOf(sourceObject.getPropertyType());
   }

   @Override
   public Integer createDestinationObject(PropertyType destinationObject) {
      return Integer.valueOf(destinationObject.getPropertyType());
   }

   @Override
   protected boolean disableAutoMapping() {
      return true;
   }
}
